package demo.prototype;

/**
 * @author wangql
 */
public class Main {
    public static void main(String[] args) throws CloneNotSupportedException {
        Address address = new Address("木叶村", "fire");
        User user = new User("张三", address);

        User low = (User) user.clone();
        User deep = (User) user.deepClone();
        System.out.println(user);
        System.out.println(low);
        System.out.println(deep);

        address.setName("光之国");
        address.setLocation("m78");

        System.out.println(user);
        System.out.println(low);
        System.out.println(deep);

        System.out.println(user.getAddress().hashCode());
        System.out.println(deep.getAddress().hashCode());
        System.out.println(low.getAddress().hashCode());

    }
}
